from struct import unpack
class ReadBinary:
    def loadBinary(self,file):
        self.f = open(file, 'rb')
        self.instruction = []
        while(1):
            self.b4 = self.f.read(4)
            if (self.b4):
                self.instruction.append( unpack('<L',self.b4)[0] )
            else:
                break

    def returnBinary(self):
        return self.instruction

    def returnTextStart(self):
        return 0x00000002
    
    def returnDataHeader(self):
        return self.instruction[0]

    def returnText(self):
        self.text=[]
        i = self.returnTextStart()
        #eventualy have i = dataheadervalue
        self.instructionLength = len(self.instruction)
        for i in range(self.instructionLength):
            self.text.append(self.instruction[i])
        return self.text
